<template>
    <view class="w-full">
     
        <radio :checked="isRead" @click="handleChange">
            <view class="text-xs flex">我已阅读并同意
                <view>
                    <navigator class="text-primary" url="/pages/agreement/index?type=server" open-type="navigate" hover-class="navigator-hover">
                        《服务协议》
                    </navigator>
                </view>
                和
                <view>
                    <navigator class="text-primary" url="/pages/agreement/index?type=privacy" open-type="navigate" hover-class="navigator-hover">
                        《隐私协议》
                    </navigator>
                </view>
            </view>
        </radio>
    </view>
</template>
<script lang="ts" setup>
const radioValue = 'agreed'
const props = defineProps({
    isRead: {
        type: Boolean,
        default: false
    }
})
const emits = defineEmits(['update:isRead'])
function handleChange() {
    if (props.isRead) {
        emits('update:isRead', false)
    } else {
        emits('update:isRead', true)
    }

}

</script>